package com.itheima.service;

import com.itheima.mapper.LoginMapper;
import com.itheima.pojo.Emp;
import com.itheima.pojo.LoginInfo;
import com.itheima.pojo.Result;
import com.itheima.pojo.login.Dto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class LoginServiceImpl implements LoginService{
    @Autowired
    private LoginMapper loginMapper;
    @Override
    public LoginInfo login(Dto dto) {
        LoginInfo d = loginMapper.selectNameAndPassword(dto);
        if (d != null){
            log.info("登陆成功,员工信息 : {}",d);
            return new LoginInfo(d.getId(),d.getUsername(),d.getName(),"");
        }
        return null ;

    }
}
